/**
 * 
 */


function createObject()
{

     var sceneControl = new SceneControl();
};
createObject.prototype.initUI=function()
{
      var panel=document.getElementById("controlpanel");
      var osg= document.createElement('input');
      osg.type="sebtn";
      osg.name="创建osg模型";
      document.write("创建osg模型\n");
      osg.oncheck=function(){
      var sceneMgr = new SceneManager();
	var sceneControl = new SceneControl();
	var sceneView = new SceneView();
      var mathUtili = sceneControl.mathUtility();
	  
      system = sceneMgr.createModelObject1(filePath);
      sceneView.flyTo(108.95942, 34.21964, 0, 0, 550);
      //获取根节点
      var rootNode = sceneMgr.getRootSceneNode(0);
      //创建子节点
      var trans = sceneControl.Vector3();
      trans.Set(1, 1, 1);
      var quat = sceneControl.Quaternion();
      quat.Set(1, 0, 0, 0);
      var sceneNode = rootNode.CreateChild(0, trans, quat);
      system.Load();
      system.AttachToNode(sceneNode);
      var matrix = mathUtili.computeMatrixFromLonLatAltEulerAngleScale(108.95942, 34.21964, 480, 0, 0, 0, trans);
      sceneNode.Matrix = matrix;            
      var util = system.FxParticleUtil;
      util.ParticleWidth = 10;
      };
      panel.appendChild(osg);


      var FBX= document.createElement('input');
      FBX.type="sebtn";
      FBX.name="创建FBX模型";
      document.write("创建FBX模型");
      FBX.oncheck=function(){
      var sceneMgr = new SceneManager();
	  var sceneControl = new SceneControl();
	  var sceneView = new SceneView();
	 var mathUtili = sceneControl.mathUtility();
      system = sceneMgr.createModelObject1(filePath);
      sceneView.flyTo(108.95942, 34.21964, 0, 0, 550);
      //获取根节点
      var rootNode = sceneMgr.getRootSceneNode(0);
      //创建子节点
      var trans = sceneControl.Vector3();
      trans.Set(1, 1, 1);
      var quat = sceneControl.Quaternion();
      quat.Set(1, 0, 0, 0);
      var sceneNode = rootNode.CreateChild(0, trans, quat);
      system.Load();
      system.AttachToNode(sceneNode);
      var matrix = mathUtili.computeMatrixFromLonLatAltEulerAngleScale(108.95942, 34.21964, 480, 0, 0, 0, trans);
      sceneNode.Matrix = matrix;            
      var util = system.FxParticleUtil;
      util.ParticleWidth = 10;
      };
      panel.appendChild(FBX);
  

      var sst= document.createElement('input');
      sst.type="sebtn";
      sst.name="数据库连接测试";
      document.write("数据库连接测试");
    
      sst.oncheck=function(){
      var sceneCtr = new SceneControl();
      var modelSo = sceneCtr.modelSource();
      var dbcon = sceneCtr.dbConnectParam();
      dbcon.DBType = 2;
      dbcon.Host = "192.168.0.1";
      dbcon.Port = 1521;
      dbcon.DBName = "fasd";
      dbcon.User = "name";
      dbcon.Passwd = "xcxc";
      
      var isSuccess = modelSo.OpenSource(dbcon);
      if(isSuccess){
            alert("OK");
      }
      };
      panel.appendChild(sst);
}
module.exports = createObject;
      
